<template>
  <div class="pagination">
    <el-pagination
      @size-change="handleSizeChange"
      @current-change="handleCurrentChange"
      :total="formData.total"
      :page-size="formData.pageSize"
      layout="total, sizes, prev, pager, next, jumper"
      background
    >
    </el-pagination>
  </div>
</template>
<script>
export default {
  props: {
    formData: {
      type: Object,
    },
  },
  methods: {
    handleCurrentChange(val) {
      this.formData.pageNo = val;
      this.$emit("load");
    },
    handleSizeChange(val) {
      this.formData.pageSize = val;
      this.$emit("load");
    },
  },
};
</script>
<style lang="less" scoped>
.pagination{
  padding-top: 20px;
  text-align: right;
}
</style>